-
Notifications
You must be signed in to change notification settings - Fork 280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: fahrenheit to celsius in codebase, part 1 #2570
Conversation
f76d5ca
to
9845588
Compare
d572e2b
to
819dcce
Compare
ok but if temperature displays anywhere in game (I don't know if it does or not) let people choose to see it in Fahrenheit |
Already a thing, if you have a thermometer it will show the ambient temp, and interface settings allow you to pick what unit it'll show as. PR's focus is on changing what unit it works with under the hood, which is then converted for display. |
src/gamemode_defense.cpp
Outdated
@@ -98,7 +98,7 @@ defense_game::defense_game() | |||
bool defense_game::init() | |||
{ | |||
calendar::turn = calendar::turn_zero + 12_hours; // Start at noon | |||
get_weather().temperature = 65; | |||
get_weather().temperature = SPRING_TEMPERATURE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not caused here or anything like that, but nowadays our "effective spring temperature" is taken from json. In the future, this should be something like get_weather().recalculate()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you point out the part where weather_manager loads spring temperature from JSON? i couldn't find serialize
or deserialize
member function in weather_manager
class.
discussed in cataclysmbnteam#2570 (comment) Co-authored-by: Coolthulhu <[email protected]>
discussed in - cataclysmbnteam#2570 (comment) - cataclysmbnteam#2570 (comment) Co-authored-by: Coolthulhu <[email protected]>
discussed in: cataclysmbnteam#2570 (comment) Co-authored-by: Coolthulhu <[email protected]>
discussed in cataclysmbnteam#2570 (comment) Co-authored-by: Coolthulhu <[email protected]>
discussed in cataclysmbnteam#2570 (comment) Co-authored-by: Coolthulhu <[email protected]>
discussed in - cataclysmbnteam#2570 (comment) - cataclysmbnteam#2570 (comment) Co-authored-by: Coolthulhu <[email protected]>
discussed in: cataclysmbnteam#2570 (comment) Co-authored-by: Coolthulhu <[email protected]>
5d4c7e9
to
22add02
Compare
discussed in cataclysmbnteam#2570 (comment) Co-authored-by: Coolthulhu <[email protected]>
discussed in cataclysmbnteam#2570 (comment) Co-authored-by: Coolthulhu <[email protected]>
discussed in - cataclysmbnteam#2570 (comment) - cataclysmbnteam#2570 (comment) Co-authored-by: Coolthulhu <[email protected]>
997fbd2
to
3ef65c7
Compare
see: cataclysmbnteam#2570 (comment) Co-authored-by: olanti-p <[email protected]>
3ef65c7
to
1d6bae6
Compare
please forgive me for shilling SI unit this much. Hardcoded as changing to celsius reduces array size a lot, and i've spent 6h unsuccessfully porting this calc_hourly_rotpoints_at_temp to work with celsius
see: cataclysmbnteam#2570 (comment) Co-authored-by: olanti-p <[email protected]>
already managed by `weather_manager::update_weather`
1d6bae6
to
5bea945
Compare
discussed in cataclysmbnteam#2570 (comment) Co-authored-by: Coolthulhu <[email protected]>
discussed in - cataclysmbnteam#2570 (comment) - cataclysmbnteam#2570 (comment) Co-authored-by: Coolthulhu <[email protected]>
discussed in: cataclysmbnteam#2570 (comment) Co-authored-by: Coolthulhu <[email protected]>
discussed in cataclysmbnteam#2570 (comment) Co-authored-by: Coolthulhu <[email protected]>
discussed in cataclysmbnteam#2570 (comment) Co-authored-by: Coolthulhu <[email protected]>
discussed in - cataclysmbnteam#2570 (comment) - cataclysmbnteam#2570 (comment) Co-authored-by: Coolthulhu <[email protected]>
discussed in: cataclysmbnteam#2570 (comment) Co-authored-by: Coolthulhu <[email protected]>
discussed in cataclysmbnteam#2570 (comment) Co-authored-by: Coolthulhu <[email protected]>
* refactor: `water_temperature` to `units::temperature` * refactor: `weather_manager::temperatrue` to `units::temperature` * refactor: explicitly use `to_millidegree_celsius` discussed in #2570 (comment) Co-authored-by: Coolthulhu <[email protected]> * refactor: simplify celsisus to fahrenheit calls discussed in - #2570 (comment) - #2570 (comment) Co-authored-by: Coolthulhu <[email protected]> * refactor: use `milidegree_celsius` discussed in: #2570 (comment) Co-authored-by: Coolthulhu <[email protected]> * refactor: make arbitrary temperatures look arbitrary discussed in #2570 (comment) Co-authored-by: Coolthulhu <[email protected]> * test: adjust lossy conversion from fahrenheit to celsius * refactor: remove `freezing_point` it was never used for years. * fix: round temperature manually * refactor: use `units::temperature` for `weather_manager` --------- Co-authored-by: Coolthulhu <[email protected]>
Summary
SUMMARY: Infrastructure "Replace fahrenheit usage to celsius in codebase, part 1"
Purpose of change
Describe the solution
units::temperatures
fortemperatures
constantsunits::temperatures
for item rotpoint calculationrot_chart
as conversion from fahrenheit to celsius was trickyDescribe alternatives you've considered
screm
Testing
all local test passed.
Additional context
help